notebook: Reorder expose function in preparation of draw vfunc
authorBenjamin Otte <otte@redhat.com>
Mon, 6 Sep 2010 21:18:14 +0000 (23:18 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:37 +0000 (15:11 +0200)
gtk/gtknotebook.c

index 1282081d3b83600eb3d43ca273e2ec6f62bc12ca..9b4ad40504881d364bec41d055452d2b608d549a 100644 (file)
@@ -2249,32 +2249,7 @@ gtk_notebook_expose (GtkWidget      *widget,
   GtkNotebookPrivate *priv = notebook->priv;
   gint i;
 
-  if (event->window == priv->drag_window)
-    {
-      GdkRectangle area = { 0, };
-      cairo_t *cr;
-
-      /* FIXME: This is a workaround to make tabs reordering work better
-       * with engines with rounded tabs. If the drag window background
-       * isn't set, the rounded corners would be black.
-       *
-       * Ideally, these corners should be made transparent, Either by using
-       * ARGB visuals or shape windows.
-       */
-      cr = gdk_cairo_create (priv->drag_window);
-      gdk_cairo_set_source_color (cr, &gtk_widget_get_style(widget)->bg [GTK_STATE_NORMAL]);
-      cairo_paint (cr);
-      cairo_destroy (cr);
-
-      gdk_drawable_get_size (priv->drag_window,
-                            &area.width, &area.height);
-      gtk_notebook_draw_tab (notebook,
-                            priv->cur_page,
-                            &area);
-      gtk_container_propagate_expose (GTK_CONTAINER (notebook),
-                                     priv->cur_page->tab_label, event);
-    }
-  else if (gtk_widget_is_drawable (widget))
+  if (gtk_widget_is_drawable (widget))
     {
       gtk_notebook_paint (widget, &event->area);
       if (priv->show_tabs)
@@ -2309,6 +2284,32 @@ gtk_notebook_expose (GtkWidget      *widget,
       }
     }
 
+  if (event->window == priv->drag_window)
+    {
+      GdkRectangle area = { 0, };
+      cairo_t *cr;
+
+      /* FIXME: This is a workaround to make tabs reordering work better
+       * with engines with rounded tabs. If the drag window background
+       * isn't set, the rounded corners would be black.
+       *
+       * Ideally, these corners should be made transparent, Either by using
+       * ARGB visuals or shape windows.
+       */
+      cr = gdk_cairo_create (priv->drag_window);
+      gdk_cairo_set_source_color (cr, &gtk_widget_get_style (widget)->bg [GTK_STATE_NORMAL]);
+      cairo_paint (cr);
+      cairo_destroy (cr);
+
+      gdk_drawable_get_size (priv->drag_window,
+                            &area.width, &area.height);
+      gtk_notebook_draw_tab (notebook,
+                            priv->cur_page,
+                            &area);
+      gtk_container_propagate_expose (GTK_CONTAINER (notebook),
+                                     priv->cur_page->tab_label, event);
+    }
+  
   return FALSE;
 }